Makefile: Provide way to ship livepatch test files
authorIan Jackson <ian.jackson@eu.citrix.com>
Wed, 7 Jun 2017 14:05:44 +0000 (15:05 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 14 Jun 2017 11:03:28 +0000 (12:03 +0100)
commitc55667bd0ad8f04688abfd5c6317709dc00f88ab
treea4aab00aab7258eecc6cce9f5bdcd541f0bd55b1
parent5225e70ccbb02f786647eddfeb65d6db1e230782
Makefile: Provide way to ship livepatch test files

In the toplevel Makefile, provide build-tests and install-tests
targets which descend into xen/test.  (dist-tests is provided
automatically by the pattern rule, as is the convention here.)

We have to set BASEDIR ourselves, and use these curious runes, because
the convention in Makefiles under xen/ is to "make -f Rules.mk" with
BASEDIR set and to expect Rules.mk to reinvoke the per-directory
Makefile.  (This is really very strange.)  Normally this invocation
pattern is organised by the machinery in xen/Makefile (which sets
BASEDIR) and Rules.mk, but we need to invoke it from outside that
context.

In theory it would be nice to have a pattern rule %-tests.  But this
is not the style in the rest of the toplevel Makefile; and doing that
might interfere with the dist-% pattern rule.

None of this is invoked by default.  If install-tests or dist-tests is
requested, the livepatches (the only current output from xen/tests)
are shipped in DESTDIR/usr/lib/debug/xen-livepatch/.

This allows CI systems such as osstest which are trying to consume
this to arrange for the files to be built, and output, without them
having to have special knowledge of the details of Xen's build system.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Release-acked-by: Julien Grall <julien.grall@arm.com>
Makefile